package com.njwd.rpc.consumer.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.njwd.common.rpc.ResponseVo;
import com.njwd.rpc.api.UserSimpleSerivices;
import com.njwd.rpc.vo.User;

@Controller
@RequestMapping("/p")
public class UserController {

	@Autowired
	UserSimpleSerivices userSimpleSerivices;
	
	@RequestMapping(value="/invoke" ,method = RequestMethod.GET)
	public void invoke(HttpServletResponse response,@RequestParam String pos) throws IOException{
		
		ResponseVo<List<User>> r=	userSimpleSerivices.queryUserByClassId(pos,"1");
		PrintWriter pw =	response.getWriter();
		pw.write(r.toString());
		pw.close();
		
	}
	
}
